package StudyCode.summary.mydatetime;

import java.text.Format;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CustomFormatDate {
	public static void main(String[] argv) throws Exception {
		Format formatter;
		Date date = new Date();

		formatter = new SimpleDateFormat("MM/dd/yy");
		String s = formatter.format(date);
		System.out.println(s);

		formatter = new SimpleDateFormat("dd-MMM-yy");
		s = formatter.format(date);
		System.out.println(s);

		formatter = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");
		s = formatter.format(date);
		System.out.println(s);

		formatter = new SimpleDateFormat("E, dd MMM yyyy HH:mm:ss Z");
		s = formatter.format(date);
		System.out.println(s);
	}
}
